#ifndef _ECLIPSE_TYPES_H_
#define _ECLIPSE_TYPES_H_

typedef float   pixelvalue ;
#define TABSPERPIX      (1000)
#define KERNEL_WIDTH    (2.0)
#define KERNEL_SAMPLES  (1+(int)(TABSPERPIX * KERNEL_WIDTH))
#define PI_NUMB     (3.1415926535897932384626433832795)
#define TANH_STEEPNESS   (5.0)
#define MAX_COLUMN_NUMBER  (40000)
#define MAX_LINE_NUMBER    (40000)


typedef struct _image_
{
  /* Size of the image in x and y */
  int                 lx, ly ;
  /* Pointer to pixel buffer as a 1d buffer */
  pixelvalue      *   data ;
} image_t ;

typedef struct _2D_POLY_ {
  int  nc ;       /* number of coefficients in px, py, c */
  int  * px ;     /* powers of x                         */
  int  * py ;     /* powers of y                         */
  double *  c ;   /* polynomial coefficients             */
} poly2d ;

image_t * image_warp_linear(image_t *image_in, double *param, char *kernel_type);
double * invert_linear_transform(double * trans);
double * generate_interpolation_kernel(char * kernel_type);
image_t * image_new(int size_x, int size_y);
void image_del(image_t * d);
double * generate_tanh_kernel(double steep);
double sinc(double x);
void reverse_tanh_kernel(double * data, int nn);
double poly2d_compute(poly2d  *p,double x, double y);

#endif
